<InputScreenDemo>:
    BoxLayout:
        orientation: 'vertical'
        canvas.before:
            Color:
                rgba: [0.436, 0.44, 0.444, 1.0]
            Rectangle:
                pos: self.pos
                size: self.size
        
        Label:
            font_name: 'LatoRegular'
            canvas.before:
                Color:
                    rgba: [0.96, 0.97, 0.97, 1.0]
                Rectangle:
                    pos: self.pos
                    size: self.size
            text: 'Patient Profile'
            color: [0.436, 0.44, 0.444, 1.0]
            size_hint: 1, 0.15
            font_size: 28

        Label:
            font_name: 'LatoRegular'
            text: 'Demographics'
            color: [0.96, 0.97, 0.97, 1.0]
            size_hint: 1, 0.1
            font_size: 24

        GridLayout:
            size_hint: 1, 0.67
            rows: 2
            cols: 3
            padding: 50, 15
            spacing: 15, 30
            row_default_height: "30dp"
            row_force_default: True

            Label:
                font_name: 'LatoRegular'
                text: "Age"
            TextInput:
                text: ""
                multiline: False
                input_type: 'number'
                input_filter: 'float'
                on_text: app.set_var_value("AGE", args[1])
            Label:
                text_size: self.size[0] - 10, self.size[1] 
                halign: 'left'
                valign: 'middle'
                size_hint: 0.5, 1 
                font_name: 'LatoRegular'
                text: "years"
            Label:
                font_name: 'LatoRegular'
                text: "Gender"
            Spinner:
                name: "GENDER.val"
                text: "Unknown"
                values: ["Unknown", "Female", "Male"]
                on_text: app.set_var_value("GENDER", self.text)
            Label:
                size_hint: 0.5, 1
                text: ""

        AnchorLayout:
            size_hint: 1, 0.08
            anchor_x: 'right'
            anchor_y: 'top'            
            ImageButton:
                source: "./buttons/next.png"
                size_hint: 0.5, 0.8
                on_press: app.go_screen(2)

<InputScreenChart>:
    BoxLayout:
        orientation: 'vertical'
        canvas.before:
            Color:
                rgba: [0.436, 0.44, 0.444, 1.0]
            Rectangle:
                pos: self.pos
                size: self.size
        
        Label:
            font_name: 'LatoRegular'
            canvas.before:
                Color:
                    rgba: [0.96, 0.97, 0.97, 1.0]
                Rectangle:
                    pos: self.pos
                    size: self.size
            text: 'Patient Profile'
            color: [0.436, 0.44, 0.444, 1.0]
            size_hint: 1, 0.15
            font_size: 28

        Label:
            font_name: 'LatoRegular'
            text: 'Clinical chart'
            color: [0.96, 0.97, 0.97, 1.0]
            size_hint: 1, 0.1
            font_size: 24

        GridLayout:
            size_hint: 1, 0.67
            rows: 5
            cols: 3
            padding: 50, 15
            spacing: 15, 30
            row_default_height: "30dp"
            row_force_default: True

            Label:
                font_name: 'LatoRegular'
                text: "Temperature"
            TextInput:
                text: ""
                multiline: False
                input_type: 'number'
                input_filter: 'float'
                on_text: app.set_var_value("TEMP", args[1])
            Spinner:
                # How to customize a spinner:
                # https://github.com/kivy/kivy/wiki/Styling-a-Spinner-and-SpinnerOption-in-KV
                name: "TEMP.unit"
                text_size: self.size[0] - 10, self.size[1] 
                halign: 'left'
                valign: 'middle'
                size_hint: 0.5, 1 
                text: "C"
                values: ["C", "F"]
                on_text: app.set_var_unit("TEMP", self.text)
            Label:
                font_name: 'LatoRegular'
                text: "Heart rate"
            TextInput:
                text: ""
                multiline: False
                input_type: 'number'
                input_filter: 'float'
                on_text: app.set_var_value("HRATE", args[1])
            Label:
                text_size: self.size[0] - 10, self.size[1] 
                halign: 'left'
                valign: 'middle'
                size_hint: 0.5, 1 
                font_name: 'LatoRegular'
                text: "BPM"
            Label:
                font_name: 'LatoRegular'
                text: "Weakness"
            Spinner:
                name: "WEAK.val"
                text: "Unknown"
                values: ["Unknown", "Yes", "No"]
                on_text: app.set_var_value("WEAK", self.text)
            Label:
                size_hint: 0.5, 1
                text: ""
            Label:
                font_name: 'LatoRegular'
                text: "Vomit"
            Spinner:
                name: "VOMIT.val"
                text: "Unknown"
                values: ["Unknown", "Yes", "No"]
                on_text: app.set_var_value("VOMIT", self.text)
            Label:
                size_hint: 0.5, 1
                text: ""
            Label: 
                font_name: 'LatoRegular'
                text: "Diarrhea"
            Spinner:
                name: "DIARR.val"
                text: "Unknown"
                values: ["Unknown", "Yes", "No"]
                on_text: app.set_var_value("DIARR", self.text)
            Label:
                size_hint: 0.5, 1
                text: ""

        BoxLayout:
            orientation: 'horizontal'
            size_hint: 1, 0.08
            AnchorLayout:
                anchor_x: 'left'
                anchor_y: 'top'            
                ImageButton:
                    source: "./buttons/prev.png"
                    size_hint: 1, 0.8
                    on_press: app.go_screen(1)

            AnchorLayout:
                anchor_x: 'right'
                anchor_y: 'top'            
                ImageButton:
                    source: "./buttons/next.png"
                    size_hint: 1, 0.8
                    on_press: app.go_screen(3)

<InputScreenLab>:
    BoxLayout:
        orientation: 'vertical'
        canvas.before:
            Color:
                rgba: [0.436, 0.44, 0.444, 1.0]
            Rectangle:
                pos: self.pos
                size: self.size
        
        Label:
            font_name: 'LatoRegular'
            canvas.before:
                Color:
                    rgba: [0.96, 0.97, 0.97, 1.0]
                Rectangle:
                    pos: self.pos
                    size: self.size
            text: 'Patient Profile'
            color: [0.436, 0.44, 0.444, 1.0]
            size_hint: 1, 0.15
            font_size: 28

        Label:
            font_name: 'LatoRegular'
            text: 'Metabolic panel'
            color: [0.96, 0.97, 0.97, 1.0]
            size_hint: 1, 0.1
            font_size: 24

        GridLayout:
            size_hint: 1, 0.67
            rows: 5
            cols: 3
            padding: 50, 15
            spacing: 15, 30
            row_default_height: "30dp"
            row_force_default: True

            Label:
                size_hint: 0.2, 1 
                font_name: 'LatoRegular'
                text: "AST"
            TextInput:
                text: ""
                multiline: False
                input_type: 'number'
                input_filter: 'float'
                size_hint: 0.4, 1
                on_text: app.set_var_value("AST_1", args[1])
            Label:
                text_size: self.size[0] - 10, self.size[1]
                halign: 'left'
                valign: 'middle'
                size_hint: 0.4, 1 
                font_name: 'LatoRegular'
                text: "U/L"
            Label:
                size_hint: 0.2, 1 
                font_name: 'LatoRegular'
                text: "ALK"
            TextInput:
                text: ""
                multiline: False
                input_type: 'number'
                input_filter: 'float'
                size_hint: 0.4, 1
                on_text: app.set_var_value("AlkPhos_1", args[1])
            Label:
                text_size: self.size[0] - 10, self.size[1]
                halign: 'left'
                valign: 'middle'
                size_hint: 0.4, 1
                font_name: 'LatoRegular'
                text: "U/L"
            Label:
                size_hint: 0.2, 1 
                font_name: 'LatoRegular'
                text: "CRE"
            TextInput:
                text: ""
                multiline: False
                input_type: 'number'
                input_filter: 'float'
                size_hint: 0.4, 1
                on_text: app.set_var_value("Cr_1", args[1])
            Spinner:
                name: "Cr_1.unit"
                text_size: self.size[0] - 10, self.size[1]
                halign: 'left'
                valign: 'middle'
                size_hint: 0.4, 1
                font_name: 'LatoRegular'
                text: "U/L"
                text: "umol/L"
                values: ["umol/L", "mg/dL"]
                on_text: app.set_var_unit("Cr_1", self.text)
            Label:
                size_hint: 0.2, 1 
                font_name: 'LatoRegular'
                text: "tCO2"
            TextInput:
                text: ""
                multiline: False
                input_type: 'number'
                input_filter: 'float'
                size_hint: 0.4, 1
                on_text: app.set_var_value("TCo2_1", args[1])
            Label:
                text_size: self.size[0] - 10, self.size[1]
                halign: 'left'
                valign: 'middle'
                size_hint: 0.4, 1
                font_name: 'LatoRegular'
                text: "mmol/L"
            Label:
                size_hint: 0.2, 1 
                font_name: 'LatoRegular'
                text: "BUN"
            TextInput:
                text: ""
                multiline: False
                input_type: 'number'
                input_filter: 'float'
                size_hint: 0.4, 1
                on_text: app.set_var_value("BUN_1", args[1])
            Spinner:
                name: "BUN_1.unit"
                text_size: self.size[0] - 10, self.size[1] 
                halign: 'left'
                valign: 'middle'
                size_hint: 0.4, 1
                text: "mmol urea/L"
                values: ["mmol urea/L", "mg/dL"]
                on_text: app.set_var_unit("BUN_1", self.text)

        BoxLayout:
            orientation: 'horizontal'
            size_hint: 1, 0.08
            AnchorLayout:
                anchor_x: 'left'
                anchor_y: 'top'            
                ImageButton:
                    source: "./buttons/prev.png"
                    size_hint: 1, 0.8
                    on_press: app.go_screen(2)

            AnchorLayout:
                anchor_x: 'right'
                anchor_y: 'top'            
                ImageButton:
                    source: "./buttons/next.png"
                    size_hint: 1, 0.8
                    on_press: app.go_screen(4)

<InputScreenPCR>:
    BoxLayout:
        orientation: 'vertical'
        canvas.before:
            Color:
                rgba: [0.436, 0.44, 0.444, 1.0]
            Rectangle:
                pos: self.pos
                size: self.size
        
        Label:
            font_name: 'LatoRegular'
            canvas.before:
                Color:
                    rgba: [0.96, 0.97, 0.97, 1.0]
                Rectangle:
                    pos: self.pos
                    size: self.size
            text: 'Patient Profile'
            color: [0.436, 0.44, 0.444, 1.0]
            size_hint: 1, 0.15
            font_size: 28

        Label:
            font_name: 'LatoRegular'
            text: 'PCR data'
            color: [0.96, 0.97, 0.97, 1.0]
            size_hint: 1, 0.1
            font_size: 24

        GridLayout:
            size_hint: 1, 0.15
            rows: 1
            cols: 3
            padding: 50, 15
            spacing: 15, 30
            row_default_height: "30dp"
            row_force_default: True

            Label:
                size_hint: 0.3, 1
                font_name: 'LatoRegular'
                text: "Virus load"         
            TextInput:
                size_hint: 0.4, 1
                text: ""
                multiline: False
                input_type: 'number'
                input_filter: 'float'
                on_text: app.set_var_value("PCR", args[1])
            Label:
                text_size: self.size[0] - 10, self.size[1] 
                halign: 'left'
                valign: 'middle'
                size_hint: 0.3, 1 
                font_name: 'LatoRegular'
                text: "log units"

        AnchorLayout:
            size_hint: 1, 0.5
            anchor_x: 'center'
            anchor_y: 'center'
            ImageButton:
                source: "./buttons/estimate.png"
                size_hint: 1, 0.15
                on_press: app.calc_risk()

        AnchorLayout:
            size_hint: 1, 0.08
            anchor_x: 'left'
            anchor_y: 'top'
            ImageButton:
                source: "./buttons/prev.png"
                size_hint: 0.5, 0.8
                on_press: app.go_screen(3)

<ResultScreen>:
    BoxLayout:
        orientation: 'vertical'
        canvas.before:
            Color:
                rgba: [0.436, 0.44, 0.444, 1.0]
            Rectangle:
                pos: self.pos
                size: self.size
        
        Label:
            font_name: 'LatoRegular'
            canvas.before:
                Color:
                    rgba: [0.96, 0.97, 0.97, 1.0]
                Rectangle:
                    pos: self.pos
                    size: self.size
            text: 'Patient Prognosis'
            color: [0.436, 0.44, 0.444, 1.0]
            size_hint: 1, 0.15
            font_size: 28

        RelativeLayout:
            size_hint: 1, 0.55

            Widget:
                size_hint: 0.6, 0.6
                pos_hint: {'center_x': 0.5, 'center_y': 0.5}
                canvas:
                    Color:
                        rgba: [1, 1, 1, 1]
                    Rectangle:
                        source: "./images/resback.png"
                        pos: self.pos
                        size: self.size

            Widget:
                size_hint: 0.1, 0.45
                pos_hint: {'x': 0.3, 'y': 0.25}
                canvas.before:
                    Color:
                        rgba: root.curr_risk_color
                    Rectangle:
                        pos: self.pos
                        size: self.size[0], self.size[1] * root.curr_risk_level
                    Color:
                        rgba: [0, 0, 0, 1]
                    Line:
                        width: 0.5
                        points: [self.pos[0], self.pos[1], self.pos[0] + root.size[0] * 0.4, self.pos[1]]

            Label:
                font_name: 'LatoRegular'
                text: str(root.curr_risk_label)
                color: [0.136, 0.14, 0.144, 1.0]
                pos_hint: {'center_x': 0.5, 'center_y': 0.75} 

            Label:
                font_name: 'LatoRegular' 
                text: "Risk level: " + "%i" % (root.curr_risk_level * 100) + "%"
                color: [0.436, 0.44, 0.444, 1.0]
                pos_hint: {'center_x': 0.6, 'center_y': 0.42} 

        AnchorLayout:
            size_hint: 1, 0.3
            anchor_x: 'center'
            anchor_y: 'center'
            ImageButton:
                source: "./buttons/enter.png"
                size_hint: 1, 0.3
                on_press: app.restart()

